/*
Navicat SQL Server Data Transfer

Source Server         : cy
Source Server Version : 160000
Source Host           : 192.168.100.1:1433
Source Database       : cks2412_1
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 160000
File Encoding         : 65001

Date: 2024-12-09 12:53:06
*/


-- ----------------------------
-- Table structure for datastatus
-- ----------------------------
DROP TABLE [dbo].[datastatus]
GO
CREATE TABLE [dbo].[datastatus] (
[Id] uniqueidentifier NOT NULL ,
[ContentStatus] int NULL ,
[Content] nvarchar(100) NULL ,
[ContentType] nvarchar(100) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO

-- ----------------------------
-- Table structure for detectiondetail
-- ----------------------------
DROP TABLE [dbo].[detectiondetail]
GO
CREATE TABLE [dbo].[detectiondetail] (
[Id] uniqueidentifier NOT NULL ,
[ParentId] uniqueidentifier NOT NULL ,
[SecondId] bigint NOT NULL IDENTITY(1,1) ,
[PartCode] nvarchar(40) NULL ,
[PLCIP] nvarchar(20) NULL ,
[DetectedData] real NULL ,
[DetectedType] nvarchar(50) NULL ,
[DetectedTypeDisplay] nvarchar(50) NULL ,
[DetectedIndex] int NULL ,
[DetectedStatus] int NULL ,
[DetectedTime] nvarchar(50) NULL ,
[Description] nvarchar(50) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[detectiondetail]', RESEED, 2547623)
GO

-- ----------------------------
-- Table structure for equipmentfailure
-- ----------------------------
DROP TABLE [dbo].[equipmentfailure]
GO
CREATE TABLE [dbo].[equipmentfailure] (
[Id] uniqueidentifier NOT NULL ,
[PLCIP] nvarchar(20) NULL ,
[ContentZH] nvarchar(255) NULL ,
[Language] nvarchar(20) NULL ,
[FailureIndex] int NULL ,
[FailureOffset] real NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL ,
[ContentEN] varchar(255) NULL ,
[ContentES] varchar(255) NULL 
)


GO

-- ----------------------------
-- Table structure for equipmentfailurehistory
-- ----------------------------
DROP TABLE [dbo].[equipmentfailurehistory]
GO
CREATE TABLE [dbo].[equipmentfailurehistory] (
[Id] uniqueidentifier NOT NULL ,
[FailureId] uniqueidentifier NOT NULL ,
[StartTime] datetime NULL ,
[EndTime] datetime NULL ,
[TotalTime] nvarchar(20) NULL ,
[FaultType] bit NULL ,
[Content] nvarchar(100) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO

-- ----------------------------
-- Table structure for indicatortolerancezone
-- ----------------------------
DROP TABLE [dbo].[indicatortolerancezone]
GO
CREATE TABLE [dbo].[indicatortolerancezone] (
[Id] uniqueidentifier NOT NULL ,
[PLCIP] nvarchar(20) NULL ,
[Indicator] real NULL ,
[ToleranceZone] real NULL ,
[Content] nvarchar(100) NULL ,
[ContentType] nvarchar(100) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO

-- ----------------------------
-- Table structure for keyencedatadetail
-- ----------------------------
DROP TABLE [dbo].[keyencedatadetail]
GO
CREATE TABLE [dbo].[keyencedatadetail] (
[Id] uniqueidentifier NOT NULL ,
[ParentId] uniqueidentifier NOT NULL ,
[PartCode] nvarchar(40) NULL ,
[PLCIP] nvarchar(20) NULL ,
[DetectedData] real NULL ,
[DetectedType] nvarchar(50) NULL ,
[DetectedIndex] int NULL ,
[DetectedStatus] int NULL ,
[DetectedTime] nvarchar(50) NULL ,
[Description] nvarchar(50) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO

-- ----------------------------
-- Table structure for op10coredata
-- ----------------------------
DROP TABLE [dbo].[op10coredata]
GO
CREATE TABLE [dbo].[op10coredata] (
[Id] bigint NOT NULL IDENTITY(1,1) ,
[serialNumber] nvarchar(100) NULL ,
[testTime] datetime NULL ,
[judge] nvarchar(50) NULL ,
[horizontalCamber] real NULL ,
[unit] nvarchar(50) NULL ,
[passageway] nvarchar(50) NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[op10coredata]', RESEED, 197424)
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'Id')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'Id'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'Id'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'serialNumber')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'零件二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'零件二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'testTime')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'测试时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'测试时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'judge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'judge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'judge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'horizontalCamber')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'检测值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'horizontalCamber'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'检测值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'horizontalCamber'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'unit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'unit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'unit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op10coredata', 
'COLUMN', N'passageway')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'通道'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'通道'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op10coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
GO

-- ----------------------------
-- Table structure for op20coredata
-- ----------------------------
DROP TABLE [dbo].[op20coredata]
GO
CREATE TABLE [dbo].[op20coredata] (
[Id] bigint NOT NULL IDENTITY(1,1) ,
[serialNumber] nvarchar(100) NULL ,
[testTime] datetime NULL ,
[voltageAC] real NULL ,
[voltageACUnit] nvarchar(50) NULL ,
[currentAC] real NULL ,
[currentACUnit] nvarchar(50) NULL ,
[resultAC] nvarchar(50) NULL ,
[voltageDC] real NULL ,
[voltageDCUnit] nvarchar(50) NULL ,
[currentDC] real NULL ,
[currentDCUnit] nvarchar(50) NULL ,
[resultDC] nvarchar(50) NULL ,
[passageway] nvarchar(50) NULL ,
[totalLength] real NULL ,
[totalLengthJudge] nvarchar(50) NULL ,
[totalLengthUnit] nvarchar(50) NULL ,
[bhverticality] real NULL ,
[bhverticalityUnit] nvarchar(50) NULL ,
[bhverticalityJudge] nvarchar(50) NULL ,
[shverticality] real NULL ,
[shverticalityUnit] nvarchar(50) NULL ,
[shverticalityJudge] nvarchar(50) NULL ,
[shverticalityTotalJudge] nvarchar(50) NULL ,
[finalJudge] nvarchar(50) NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[op20coredata]', RESEED, 207506)
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'Id')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'Id'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'Id'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'serialNumber')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'testTime')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'voltageAC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'AC电压'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageAC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'AC电压'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageAC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'voltageACUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'AC电压单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageACUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'AC电压单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageACUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'currentAC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'AC电流'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentAC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'AC电流'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentAC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'currentACUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'AC电流单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentACUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'AC电流单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentACUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'resultAC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'AC判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'resultAC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'AC判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'resultAC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'voltageDC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'DC电压'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageDC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'DC电压'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageDC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'voltageDCUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'DC电压单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageDCUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'DC电压单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'voltageDCUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'currentDC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'DC电流'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentDC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'DC电流'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentDC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'currentDCUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'DC电流单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentDCUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'DC电流单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'currentDCUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'resultDC')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'DC判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'resultDC'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'DC判定（OK/NG）'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'resultDC'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'passageway')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'通道信息'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'通道信息'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'totalLength')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'总长'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLength'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'总长'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLength'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'totalLengthJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'total LengthJudge判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLengthJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'total LengthJudge判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLengthJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op20coredata', 
'COLUMN', N'totalLengthUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'totalLengthUnit单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLengthUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'totalLengthUnit单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op20coredata'
, @level2type = 'COLUMN', @level2name = N'totalLengthUnit'
GO

-- ----------------------------
-- Table structure for op30coredata
-- ----------------------------
DROP TABLE [dbo].[op30coredata]
GO
CREATE TABLE [dbo].[op30coredata] (
[Id] bigint NOT NULL IDENTITY(1,1) ,
[serialNumber] nvarchar(100) NULL ,
[testTime] datetime NULL ,
[passageway] nvarchar(50) NULL ,
[facadeCamber] real NULL ,
[camberJudge] nvarchar(50) NULL ,
[camberUnit] nvarchar(50) NULL ,
[backScallop3Pitch] real NULL ,
[backScallop3Diameter] real NULL ,
[maxThickness] real NULL ,
[maxThicknessJudge] nvarchar(50) NULL ,
[maxThicknessUnit] nvarchar(50) NULL ,
[miniThickness] real NULL ,
[miniThicknessJudge] nvarchar(50) NULL ,
[miniThicknessUnit] nvarchar(50) NULL ,
[finalJudge] nvarchar(50) NULL ,
[sc01] real NULL ,
[sc02] real NULL ,
[sc03] real NULL ,
[sc04] real NULL ,
[sedJudge] varchar(255) NULL ,
[sc01Unit] varchar(255) NULL ,
[sc01judge] varchar(255) NULL ,
[sc02Unit] varchar(255) NULL ,
[sc03Unit] varchar(255) NULL ,
[sc04Unit] varchar(255) NULL ,
[sc02judge] varchar(255) NULL ,
[sc03judge] varchar(255) NULL ,
[sc04judge] varchar(255) NULL ,
[scTotalJudge] nvarchar(50) NULL ,
[thicknessJudge] nvarchar(50) NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[op30coredata]', RESEED, 197340)
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'serialNumber')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'二维码'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'serialNumber'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'testTime')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'testTime'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'passageway')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'通道信息'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'通道信息'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'passageway'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'facadeCamber')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'立面拱曲度'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'facadeCamber'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'立面拱曲度'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'facadeCamber'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'camberJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'拱曲度结果判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'camberJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'拱曲度结果判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'camberJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'camberUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'camberUnit单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'camberUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'camberUnit单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'camberUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'backScallop3Pitch')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'背面波间距'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'backScallop3Pitch'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'背面波间距'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'backScallop3Pitch'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'backScallop3Diameter')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'背面波直径'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'backScallop3Diameter'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'背面波直径'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'backScallop3Diameter'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'maxThickness')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'膜厚最大值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThickness'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'膜厚最大值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThickness'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'maxThicknessJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'膜厚最大值判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThicknessJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'膜厚最大值判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThicknessJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'maxThicknessUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThicknessUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'maxThicknessUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'miniThickness')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'膜厚最小值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThickness'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'膜厚最小值'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThickness'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'miniThicknessJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'膜厚最小值判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThicknessJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'膜厚最小值判定'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThicknessJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'miniThicknessUnit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'最小值单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThicknessUnit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'最小值单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'miniThicknessUnit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'finalJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'OP30最总判定=camber结果，上膜厚判定='
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'finalJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'OP30最总判定=camber结果，上膜厚判定='
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'finalJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc01')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-64'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-64'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc02')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-1'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-1'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc03')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc04')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sedJudge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'小末端方向检查NG和OK'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sedJudge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'小末端方向检查NG和OK'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sedJudge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc01Unit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-64单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01Unit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-64单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01Unit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc01judge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-64波距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01judge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-64波距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc01judge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc02Unit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-1单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02Unit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-1单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02Unit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc03Unit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03Unit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03Unit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc04Unit')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04Unit'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离单位'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04Unit'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc02judge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-1波距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02judge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-1波距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc02judge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc03judge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03judge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-大端距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc03judge'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'op30coredata', 
'COLUMN', N'sc04judge')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04judge'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'C基准-小端距离结果OKNG'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'op30coredata'
, @level2type = 'COLUMN', @level2name = N'sc04judge'
GO

-- ----------------------------
-- Table structure for PerformanceRecord
-- ----------------------------
DROP TABLE [dbo].[PerformanceRecord]
GO
CREATE TABLE [dbo].[PerformanceRecord] (
[Id] uniqueidentifier NOT NULL ,
[TotalRunTime] real NULL DEFAULT ((0)) ,
[StopTime] real NULL DEFAULT ((0)) ,
[WaitingTime] real NULL DEFAULT ((0)) ,
[FaultTime] real NULL DEFAULT ((0)) ,
[LoadTime] real NULL DEFAULT ((0)) ,
[StartRate] nvarchar(255) NULL ,
[Efficiency] nvarchar(255) NULL ,
[ProductYield] nvarchar(255) NULL ,
[OEE] nvarchar(255) NULL ,
[Remarks] nvarchar(255) NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL ,
[DownTime] real NULL DEFAULT ((0)) 
)


GO

-- ----------------------------
-- Table structure for shape
-- ----------------------------
DROP TABLE [dbo].[shape]
GO
CREATE TABLE [dbo].[shape] (
[Id] uniqueidentifier NOT NULL ,
[SecondId] bigint NOT NULL IDENTITY(1,1) ,
[StationCode] nvarchar(20) NULL ,
[Heart1] bit NULL ,
[StartUpLoad] bit NULL ,
[PartCode] nvarchar(40) NULL ,
[PartCodeTrigger] bit NULL ,
[Heart2] bit NULL ,
[EndUpLoad] bit NULL ,
[Result] bit NULL ,
[PartCodeResult] int NULL ,
[RunType] nvarchar(10) NULL ,
[Pushed] bit NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[shape]', RESEED, 208635)
GO

-- ----------------------------
-- Table structure for thicknessdetection
-- ----------------------------
DROP TABLE [dbo].[thicknessdetection]
GO
CREATE TABLE [dbo].[thicknessdetection] (
[Id] uniqueidentifier NOT NULL ,
[SecondId] bigint NOT NULL IDENTITY(1,1) ,
[StationCode] nvarchar(20) NULL ,
[Heart1] bit NULL ,
[3DScannerStart] bit NULL ,
[3DScannerEnd] bit NULL ,
[StartUpLoad] bit NULL ,
[PartCode] nvarchar(40) NULL ,
[TotalLengthResult] bit NULL ,
[CRSmallEndDistanceResult] bit NULL ,
[CRLargeEndDistanceResult] bit NULL ,
[CRFront1WaveDistanceResult] bit NULL ,
[CRFront64WaveDistanceResult] bit NULL ,
[FrontThicknessResult1] bit NULL ,
[FrontThicknessResult2] bit NULL ,
[FrontThicknessResult3] bit NULL ,
[FrontThicknessResult4] bit NULL ,
[FrontThicknessResult5] bit NULL ,
[FrontThicknessResult6] bit NULL ,
[FrontThicknessResult7] bit NULL ,
[BackThicknessResult1] bit NULL ,
[BackThicknessResult2] bit NULL ,
[BackThicknessResult3] bit NULL ,
[BackThicknessResult4] bit NULL ,
[BackThicknessResult5] bit NULL ,
[BackThicknessResult6] bit NULL ,
[BackThicknessResult7] bit NULL ,
[SmallEndDirectionInspectionResult] bit NULL ,
[FacadeCurvatureResult] bit NULL ,
[Result] bit NULL ,
[Heart2] bit NULL ,
[EndUpLoad] bit NULL ,
[3DScannerResult] bit NULL ,
[RunType] nvarchar(10) NULL ,
[Pushed] bit NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[thicknessdetection]', RESEED, 228526)
GO

-- ----------------------------
-- Table structure for voltagewithstand
-- ----------------------------
DROP TABLE [dbo].[voltagewithstand]
GO
CREATE TABLE [dbo].[voltagewithstand] (
[Id] uniqueidentifier NOT NULL ,
[SecondId] bigint NOT NULL IDENTITY(1,1) ,
[StationCode] nvarchar(20) NULL ,
[Heart1] bit NULL ,
[StartUpLoad] bit NULL ,
[PartCode] nvarchar(40) NULL ,
[VoltageWithstandResult] bit NULL ,
[VoltageWithstandResultAC] bit NULL ,
[CameraDetectionResult] bit NULL ,
[Heart2] bit NULL ,
[EndUpLoad] bit NULL ,
[Result] bit NULL ,
[RunType] nvarchar(10) NULL ,
[Pushed] bit NULL ,
[CreatedTime] datetime NULL ,
[ModifiedTime] datetime NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[voltagewithstand]', RESEED, 238369)
GO

-- ----------------------------
-- Indexes structure for table datastatus
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table datastatus
-- ----------------------------
ALTER TABLE [dbo].[datastatus] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table detectiondetail
-- ----------------------------
CREATE INDEX [IDX_CreatedTime] ON [dbo].[detectiondetail]
([CreatedTime] ASC) 
GO
CREATE INDEX [ParentID_IDX] ON [dbo].[detectiondetail]
([ParentId] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table detectiondetail
-- ----------------------------
ALTER TABLE [dbo].[detectiondetail] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table equipmentfailure
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table equipmentfailure
-- ----------------------------
ALTER TABLE [dbo].[equipmentfailure] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table equipmentfailurehistory
-- ----------------------------
CREATE INDEX [NonClusteredIndex-20241024-094700] ON [dbo].[equipmentfailurehistory]
([FailureId] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table equipmentfailurehistory
-- ----------------------------
ALTER TABLE [dbo].[equipmentfailurehistory] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table indicatortolerancezone
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table indicatortolerancezone
-- ----------------------------
ALTER TABLE [dbo].[indicatortolerancezone] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table keyencedatadetail
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table keyencedatadetail
-- ----------------------------
ALTER TABLE [dbo].[keyencedatadetail] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table PerformanceRecord
-- ----------------------------
CREATE INDEX [NonClusteredIndex-20241101-182223] ON [dbo].[PerformanceRecord]
([TotalRunTime] ASC, [OEE] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table PerformanceRecord
-- ----------------------------
ALTER TABLE [dbo].[PerformanceRecord] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table shape
-- ----------------------------
CREATE INDEX [IDX_s_CreatedTime] ON [dbo].[shape]
([CreatedTime] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table shape
-- ----------------------------
ALTER TABLE [dbo].[shape] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table thicknessdetection
-- ----------------------------
CREATE INDEX [IDX_T_CreatedTime] ON [dbo].[thicknessdetection]
([CreatedTime] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table thicknessdetection
-- ----------------------------
ALTER TABLE [dbo].[thicknessdetection] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table voltagewithstand
-- ----------------------------
CREATE INDEX [IDX_V_CreatedTime] ON [dbo].[voltagewithstand]
([CreatedTime] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table voltagewithstand
-- ----------------------------
ALTER TABLE [dbo].[voltagewithstand] ADD PRIMARY KEY ([Id])
GO
